3.2.74 \(\int (g \sec (e+f x))^p (a+a \sec (e+f x))^2 (c-c \sec (e+f x)) \, dx\) [174]

Optimal. Leaf size=140 \[ -\frac {a^2 c \cos ^2(e+f x)^{\frac {3+p}{2}} \, _2F_1\left (\frac {3}{2},\frac {3+p}{2};\frac {5}{2};\sin ^2(e+f x)\right ) (g \sec (e+f x))^p \tan ^3(e+f x)}{3 f}-\frac {a^2 c \cos ^2(e+f x)^{\frac {4+p}{2}} \, _2F_1\left (\frac {3}{2},\frac {4+p}{2};\frac {5}{2};\sin ^2(e+f x)\right ) (g \sec (e+f x))^{1+p} \tan ^3(e+f x)}{3 f g} \]

[Out]

-1/3*a^2*c*(cos(f*x+e)^2)^(3/2+1/2*p)*hypergeom([3/2, 3/2+1/2*p],[5/2],sin(f*x+e)^2)*(g*sec(f*x+e))^p*tan(f*x+
e)^3/f-1/3*a^2*c*(cos(f*x+e)^2)^(2+1/2*p)*hypergeom([3/2, 2+1/2*p],[5/2],sin(f*x+e)^2)*(g*sec(f*x+e))^(1+p)*ta
n(f*x+e)^3/f/g

________________________________________________________________________________________

Rubi [A]
time = 0.14, antiderivative size = 140, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 3, integrand size = 34, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.088, Rules used = {4047, 2697, 16} \begin {gather*} -\frac {a^2 c \tan ^3(e+f x) \cos ^2(e+f x)^{\frac {p+3}{2}} (g \sec (e+f x))^p \, _2F_1\left (\frac {3}{2},\frac {p+3}{2};\frac {5}{2};\sin ^2(e+f x)\right )}{3 f}-\frac {a^2 c \tan ^3(e+f x) \cos ^2(e+f x)^{\frac {p+4}{2}} (g \sec (e+f x))^{p+1} \, _2F_1\left (\frac {3}{2},\frac {p+4}{2};\frac {5}{2};\sin ^2(e+f x)\right )}{3 f g} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(g*Sec[e + f*x])^p*(a + a*Sec[e + f*x])^2*(c - c*Sec[e + f*x]),x]

[Out]

-1/3*(a^2*c*(Cos[e + f*x]^2)^((3 + p)/2)*Hypergeometric2F1[3/2, (3 + p)/2, 5/2, Sin[e + f*x]^2]*(g*Sec[e + f*x
])^p*Tan[e + f*x]^3)/f - (a^2*c*(Cos[e + f*x]^2)^((4 + p)/2)*Hypergeometric2F1[3/2, (4 + p)/2, 5/2, Sin[e + f*
x]^2]*(g*Sec[e + f*x])^(1 + p)*Tan[e + f*x]^3)/(3*f*g)

Rule 16

Int[(u_.)*(v_)^(m_.)*((b_)*(v_))^(n_), x_Symbol] :> Dist[1/b^m, Int[u*(b*v)^(m + n), x], x] /; FreeQ[{b, n}, x
] && IntegerQ[m]

Rule 2697

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(a*Sec[e + f
*x])^m*(b*Tan[e + f*x])^(n + 1)*((Cos[e + f*x]^2)^((m + n + 1)/2)/(b*f*(n + 1)))*Hypergeometric2F1[(n + 1)/2,
(m + n + 1)/2, (n + 3)/2, Sin[e + f*x]^2], x] /; FreeQ[{a, b, e, f, m, n}, x] &&  !IntegerQ[(n - 1)/2] &&  !In
tegerQ[m/2]

Rule 4047

Int[(csc[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.)*(csc[(e_.) + (f_.)*(x_)
]*(d_.) + (c_))^(n_.), x_Symbol] :> Dist[((-a)*c)^m, Int[ExpandTrig[(g*csc[e + f*x])^p*cot[e + f*x]^(2*m), (c
+ d*csc[e + f*x])^(n - m), x], x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2
 - b^2, 0] && IntegersQ[m, n] && GeQ[n - m, 0] && GtQ[m*n, 0]

Rubi steps

\begin {align*} \int (g \sec (e+f x))^p (a+a \sec (e+f x))^2 (c-c \sec (e+f x)) \, dx &=-\left ((a c) \int \left (a (g \sec (e+f x))^p \tan ^2(e+f x)+a \sec (e+f x) (g \sec (e+f x))^p \tan ^2(e+f x)\right ) \, dx\right )\\ &=-\left (\left (a^2 c\right ) \int (g \sec (e+f x))^p \tan ^2(e+f x) \, dx\right )-\left (a^2 c\right ) \int \sec (e+f x) (g \sec (e+f x))^p \tan ^2(e+f x) \, dx\\ &=-\frac {a^2 c \cos ^2(e+f x)^{\frac {3+p}{2}} \, _2F_1\left (\frac {3}{2},\frac {3+p}{2};\frac {5}{2};\sin ^2(e+f x)\right ) (g \sec (e+f x))^p \tan ^3(e+f x)}{3 f}-\frac {\left (a^2 c\right ) \int (g \sec (e+f x))^{1+p} \tan ^2(e+f x) \, dx}{g}\\ &=-\frac {a^2 c \cos ^2(e+f x)^{\frac {3+p}{2}} \, _2F_1\left (\frac {3}{2},\frac {3+p}{2};\frac {5}{2};\sin ^2(e+f x)\right ) (g \sec (e+f x))^p \tan ^3(e+f x)}{3 f}-\frac {a^2 c \cos ^2(e+f x)^{\frac {4+p}{2}} \, _2F_1\left (\frac {3}{2},\frac {4+p}{2};\frac {5}{2};\sin ^2(e+f x)\right ) (g \sec (e+f x))^{1+p} \tan ^3(e+f x)}{3 f g}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains higher order function than in optimal. Order 6 vs. order 5 in optimal.
time = 30.37, size = 7087, normalized size = 50.62 \begin {gather*} \text {Result too large to show} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

Integrate[(g*Sec[e + f*x])^p*(a + a*Sec[e + f*x])^2*(c - c*Sec[e + f*x]),x]

[Out]

Result too large to show

________________________________________________________________________________________

Maple [F]
time = 0.18, size = 0, normalized size = 0.00 \[\int \left (g \sec \left (f x +e \right )\right )^{p} \left (a +a \sec \left (f x +e \right )\right )^{2} \left (c -c \sec \left (f x +e \right )\right )\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((g*sec(f*x+e))^p*(a+a*sec(f*x+e))^2*(c-c*sec(f*x+e)),x)

[Out]

int((g*sec(f*x+e))^p*(a+a*sec(f*x+e))^2*(c-c*sec(f*x+e)),x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*sec(f*x+e))^p*(a+a*sec(f*x+e))^2*(c-c*sec(f*x+e)),x, algorithm="maxima")

[Out]

-integrate((a*sec(f*x + e) + a)^2*(c*sec(f*x + e) - c)*(g*sec(f*x + e))^p, x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*sec(f*x+e))^p*(a+a*sec(f*x+e))^2*(c-c*sec(f*x+e)),x, algorithm="fricas")

[Out]

integral(-(a^2*c*sec(f*x + e)^3 + a^2*c*sec(f*x + e)^2 - a^2*c*sec(f*x + e) - a^2*c)*(g*sec(f*x + e))^p, x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - a^{2} c \left (\int \left (- \left (g \sec {\left (e + f x \right )}\right )^{p}\right )\, dx + \int \left (- \left (g \sec {\left (e + f x \right )}\right )^{p} \sec {\left (e + f x \right )}\right )\, dx + \int \left (g \sec {\left (e + f x \right )}\right )^{p} \sec ^{2}{\left (e + f x \right )}\, dx + \int \left (g \sec {\left (e + f x \right )}\right )^{p} \sec ^{3}{\left (e + f x \right )}\, dx\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*sec(f*x+e))**p*(a+a*sec(f*x+e))**2*(c-c*sec(f*x+e)),x)

[Out]

-a**2*c*(Integral(-(g*sec(e + f*x))**p, x) + Integral(-(g*sec(e + f*x))**p*sec(e + f*x), x) + Integral((g*sec(
e + f*x))**p*sec(e + f*x)**2, x) + Integral((g*sec(e + f*x))**p*sec(e + f*x)**3, x))

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*sec(f*x+e))^p*(a+a*sec(f*x+e))^2*(c-c*sec(f*x+e)),x, algorithm="giac")

[Out]

integrate(-(a*sec(f*x + e) + a)^2*(c*sec(f*x + e) - c)*(g*sec(f*x + e))^p, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\left (a+\frac {a}{\cos \left (e+f\,x\right )}\right )}^2\,\left (c-\frac {c}{\cos \left (e+f\,x\right )}\right )\,{\left (\frac {g}{\cos \left (e+f\,x\right )}\right )}^p \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a/cos(e + f*x))^2*(c - c/cos(e + f*x))*(g/cos(e + f*x))^p,x)

[Out]

int((a + a/cos(e + f*x))^2*(c - c/cos(e + f*x))*(g/cos(e + f*x))^p, x)

________________________________________________________________________________________